<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>滚动</title>
		<style>
			body {
				height: 3000px;
			}
		</style>
	</head>
	<body>
		<script>
			window.addEventListener('scroll', function () {
				console.log(window.pageYOffset)
			})
		</script>
	</body>
</html>
